/**
 * 农家乐模块接口列表
 */

 import base from '../base'; // 导入接口域名列表
 import axios from '../axios'; // 导入http中创建的axios实例
 //import qs from 'qs'; // 根据需求是否导入qs模块
 
 interface shop{
    address:string;
    detail:number;
 }
 interface shop_query{
    pageNum:string;
    pageSize:number;
 }
 const shop = {    
    add(params:shop){
        return axios.post(`/shop/agritainment/add`,{
            address: params.address,
            detail: params.detail,
        })
        //return axios.post(`${base.sq}/shop/agritainment/add`,qs.stringify(params))
    },
    list(query:shop_query){
        return axios.get(`/shop/agritainment/list?pageNum=${query.pageNum}&pageSize=${query.pageSize}`)
        // return axios.get(`${base.sq}/shop/agritainment/list`,{
        //     pageNum:query.pageNum,
        //     pageSize:query.pageSize
        // })
    },
    articleDetail (id:number, params:string) {        
        return axios.get(`${base.sq}/topic/${id}`, {            
            params: params        
        });    
    },
    // post提交    
    // login (params) {        
    //     return axios.post(`${base.sq}/accesstoken`, qs.stringify(params));    
    // },
    //获取区域
    getProvince(area:string,code:string){
        if(code){
            return axios.get(`${base.area}/${area}/${code}`)//getCity,getArea
        }else{
            return axios.get(`${base.area}/${area}`)//getProvince
        }
    },
 }
 
 export default shop;